package org.jeecg.modules.zcgl.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OrderTypeEnum {

    /**
     * 订单类型 1、主动支付，2、自动扣费，3、线下支付
     * */

    INITIATIVE_PAY(1, "三峡支付"),
    AUTOMATIC_DEDUCTION(2, "自动扣费"),
    OFFLINE_PAYMENT(3, "线下支付");

    int status;
    String name;

    public static String getName(Integer status){
        if (status == null){
            return null;
        }
        for (OrderTypeEnum mode : OrderTypeEnum.values()){
            if (mode.getStatus() == status.intValue()) {
                return mode.name;
            }
        }
        return null;
    }

}